package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiMtnChannelRouteMapper;
import com.ruoyi.net.domain.BusiMtnChannelRoute;
import com.ruoyi.net.service.IBusiMtnChannelRouteService;

/**
 * 业务-MTN Channel-路径配置Service业务层处理
 * 
 * @author tony
 * @date 2024-12-09
 */
@Service
public class BusiMtnChannelRouteServiceImpl implements IBusiMtnChannelRouteService 
{
    @Autowired
    private BusiMtnChannelRouteMapper busiMtnChannelRouteMapper;

    /**
     * 查询业务-MTN Channel-路径配置
     * 
     * @param id 业务-MTN Channel-路径配置主键
     * @return 业务-MTN Channel-路径配置
     */
    @Override
    public BusiMtnChannelRoute selectBusiMtnChannelRouteById(String id)
    {
        return busiMtnChannelRouteMapper.selectBusiMtnChannelRouteById(id);
    }

    /**
     * 查询业务-MTN Channel-路径配置列表
     * 
     * @param busiMtnChannelRoute 业务-MTN Channel-路径配置
     * @return 业务-MTN Channel-路径配置
     */
    @Override
    public List<BusiMtnChannelRoute> selectBusiMtnChannelRouteList(BusiMtnChannelRoute busiMtnChannelRoute)
    {
        return busiMtnChannelRouteMapper.selectBusiMtnChannelRouteList(busiMtnChannelRoute);
    }

    /**
     * 新增业务-MTN Channel-路径配置
     * 
     * @param busiMtnChannelRoute 业务-MTN Channel-路径配置
     * @return 结果
     */
    @Override
    public int insertBusiMtnChannelRoute(BusiMtnChannelRoute busiMtnChannelRoute)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiMtnChannelRoute.getId())) {
            busiMtnChannelRoute.setId(uuid);
        }
        busiMtnChannelRoute.setCreateBy(SecurityUtils.getUsername());
        busiMtnChannelRoute.setCreateTime(DateUtils.getNowDate());
        busiMtnChannelRoute.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelRoute.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelRouteMapper.insertBusiMtnChannelRoute(busiMtnChannelRoute);
    }

    /**
     * 修改业务-MTN Channel-路径配置
     * 
     * @param busiMtnChannelRoute 业务-MTN Channel-路径配置
     * @return 结果
     */
    @Override
    public int updateBusiMtnChannelRoute(BusiMtnChannelRoute busiMtnChannelRoute)
    {
        busiMtnChannelRoute.setUpdateBy(SecurityUtils.getUsername());
        busiMtnChannelRoute.setUpdateTime(DateUtils.getNowDate());
        return busiMtnChannelRouteMapper.updateBusiMtnChannelRoute(busiMtnChannelRoute);
    }

    /**
     * 批量删除业务-MTN Channel-路径配置
     * 
     * @param ids 需要删除的业务-MTN Channel-路径配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelRouteByIds(String[] ids)
    {
        return busiMtnChannelRouteMapper.deleteBusiMtnChannelRouteByIds(ids);
    }

    /**
     * 删除业务-MTN Channel-路径配置信息
     * 
     * @param id 业务-MTN Channel-路径配置主键
     * @return 结果
     */
    @Override
    public int deleteBusiMtnChannelRouteById(String id)
    {
        return busiMtnChannelRouteMapper.deleteBusiMtnChannelRouteById(id);
    }
}
